<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Adminuser extends CI_Controller {
  public function __construct() {
    parent::__construct();
  }

  public function index() {
    redirect('admin/adminuser/login');
  }

  public function login() {
//    $password = hash('sha512', 's@mfIch3r');
    $this->load->helper('form');
    $this->load->view('admin/tpls/login_view');
  }

  public function dologin() {
    if ($_POST) {
      $this->load->model('admin/adminuser_model', 'adminuser');
      $this->adminuser->do_login();
    } else {
      redirect('admin/adminuser/index');
    }
  }

  public function logout() {
		auth_user();
    $this->load->library('session');
    $this->session->sess_destroy();
    redirect('admin/adminuser/login');
  }
}